package com.zzyl.controller.manager;

import com.zzyl.base.ResponseResult;
import com.zzyl.dto.UserLoginRequestDto;
import com.zzyl.service.MemberService;
import com.zzyl.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(path = "/customer/user")
public class CustomerLoginController {

    @Autowired
    private MemberService memberService;
    /**
     * 小程序端用户登录
     * @return
     */
    @PostMapping(path = "/login")
    public ResponseResult<LoginVo> login(@RequestBody UserLoginRequestDto loginDto){
        LoginVo loginVo = memberService.customerLogin(loginDto);
        return ResponseResult.success(loginVo);
    }
}
